package br.edu.ufcg.msnlab2.gui.frames;

import java.awt.Container;

import javax.swing.JInternalFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import br.edu.ufcg.msnlab2.gui.main.MSNLab2;


//import br.edu.ufcg.msnlab.gui.MSNLab;

/**
 */
public class FrameOutput extends JInternalFrame {

	private static final long serialVersionUID = 1L;

	protected MSNLab2 msnlab;

	private Container screen;

	private JTextArea valueResult;


	public FrameOutput(MSNLab2 msnLab) {
		System.out.println("FRAME OUTPUT ");
		this.msnlab = msnLab;
		setTitle("Result ");
		initialize();
		positions();
	}

	private void initialize() {
		System.out.println("FRAME OUTPUT  INICIALIZAR ");
		screen = getContentPane();
		//setSize(600, 420);
		setSize(500, 280);
		setClosable(true);
		valueResult = new JTextArea();
		screen.add(new JScrollPane(valueResult));
	}

	public void setInformation(String v, String e){
		System.out.println("FRAME OUTPUT  SET INFORMATION");
		valueResult.setText(v);
		valueResult.setCaretPosition( valueResult.getText().length() );
		
		System.out.println("value result   " + v);
	}

	private void positions() {
		System.out.println("FRAME OUTPUT  positions");
		valueResult.setBounds(30, 0, 50, 50);
		valueResult.setVisible(true);
	}

}
